cdata = configuration_data()
cdata.set('ORCUS_MAJOR_VERSION', version_major)
cdata.set('ORCUS_MINOR_VERSION', version_minor)
cdata.set('ORCUS_MICRO_VERSION', version_micro)


configure_file(
  input: 'constants.inl.in',
  output: 'constants.inl',
  configuration: cdata,
)

orcus_lib = library(
  'orcus-0.19',
  # core
  'config.cpp',
  'css_document_tree.cpp',
  'css_selector.cpp',
  'detection_result.cpp',
  'dom_tree.cpp',
  'format_detection.cpp',
  'formula_result.cpp',
  'info.cpp',
  'interface.cpp',
  'json_document_tree.cpp',
  'json_map_tree.cpp',
  'json_structure_mapper.cpp',
  'json_structure_tree.cpp',
  'json_util.cpp',
  'spreadsheet_interface.cpp',
  'orcus_csv.cpp',
  'orcus_json.cpp',
  'orcus_xml.cpp',
  'orcus_xml_impl.cpp',
  'orcus_xml_map_def.cpp',
  'measurement.cpp',
  'xml_context_base.cpp',
  'xml_context_global.cpp',
  'xml_element_types.cpp',
  'xml_element_validator.cpp',
  'xml_empty_context.cpp',
  'xml_map_tree.cpp',
  'xml_stream_handler.cpp',
  'xml_stream_parser.cpp',
  'xml_simple_stream_handler.cpp',
  'xml_structure_mapper.cpp',
  'xml_structure_tree.cpp',
  'xml_util.cpp',
  'xpath_parser.cpp',
  'yaml_document_tree.cpp',
  'ooxml_namespace_types.cpp',
  'odf_namespace_types.cpp',
  'gnumeric_namespace_types.cpp',
  'xls_xml_namespace_types.cpp',
  'session_context.cpp',
  'spreadsheet_interface.cpp',
  'spreadsheet_iface_util.cpp',
  'spreadsheet_types.cpp',
  'spreadsheet_impl_types.cpp',
  'string_helper.cpp',
  # gnumeric filter
  #  'gnumeric_cell_context.cpp',
  #  'gnumeric_cell_context_test.cpp',
  #  'gnumeric_context.cpp',
  #  'gnumeric_detection_handler.cpp',
  #  'gnumeric_handler.cpp',
  #  'gnumeric_helper_test.cpp',
  #  'gnumeric_sheet_context.cpp',
  #  'gnumeric_sheet_context_test.cpp',
  #  'gnumeric_tokens.cpp',
  #  'orcus_gnumeric.cpp',
  # xlsx filter
  'ooxml_content_types.cpp',
  'ooxml_global.cpp',
  'ooxml_schemas.cpp',
  'ooxml_tokens.cpp',
  'ooxml_types.cpp',
  'opc_context.cpp',
  'opc_reader.cpp',
  'orcus_xlsx.cpp',
  'orcus_import_xlsx.cpp',
  'xlsx_shared_strings_context.cpp',
  'xlsx_drawing_context.cpp',
  'xlsx_handler.cpp',
  'xlsx_helper.cpp',
  'xlsx_session_data.cpp',
  'xlsx_styles_context.cpp',
  'xlsx_revision_context.cpp',
  'xlsx_pivot_context.cpp',
  'xlsx_sheet_context.cpp',
  'xlsx_conditional_format_context.cpp',
  'xlsx_table_context.cpp',
  'xlsx_autofilter_context.cpp',
  'xlsx_types.cpp',
  'xlsx_workbook_context.cpp',
  # xls-xml filter
  'xls_xml_tokens.cpp',
  'orcus_xls_xml.cpp',
  'xls_xml_detection_handler.cpp',
  'xls_xml_handler.cpp',
  'xls_xml_context.cpp',
  # ods filter
  'odf_document_styles_context.cpp',
  'odf_para_context.cpp',
  'odf_styles.cpp',
  'odf_styles_context.cpp',
  'odf_style_context.cpp',
  'odf_number_format_context.cpp',
  'odf_tokens.cpp',
  'ods_content_xml_context.cpp',
  'ods_dde_links_context.cpp',
  'ods_session_data.cpp',
  'odf_helper.cpp',
  'orcus_ods.cpp',
  'orcus_import_ods.cpp',
  cpp_args: [
    '-D__ORCUS_BUILDING_DLL',
    '-D__ORCUS_XLSX',
    '-D__ORCUS_ODS',
    '-D__ORCUS_XLS_XML',
  ],
  include_directories: ['../../include', '../include'],
  link_with: [parser_lib],
  dependencies: [boost_ios_dep, boost_fs_dep, mdds_dep, thread_dep],
)
